from django.conf.urls.defaults import *
from feeds import LatestEntries

latest_feeds = {
    'latest': LatestEntries,
    'categories': LatestEntries,
}

urlpatterns = patterns('',
    (r'^$', 'moviering.moviering.views.index'),
    (r'profile/$', 'moviering.moviering.views.profile'),
    #(r'newsletter/$', 'moviering.moviering.views.newsletter'),
    (r'send_updates/$', 'moviering.moviering.views.send_updates'),
    (r'actions/$', 'moviering.moviering.views.actions'),
    (r'add/$', 'moviering.moviering.views.add'),
    (r'add_many/$', 'moviering.moviering.views.add_many'),
    (r'add_review/$', 'moviering.moviering.views.add_review'),
    (r'^movie/(?P<movie_key>[^\.^/]+)/$', 'moviering.moviering.views.view'),
    (r'^delete/(?P<movie_key>[^\.^/]+)/$', 'moviering.moviering.views.delete'),
    (r'^update/(?P<movie_key>[^\.^/]+)/$', 'moviering.moviering.views.update'),
    #(r'^feeds/(?P<url>.*)/$', 'django.contrib.syndication.views.feed', {'feed_dict': latest_feeds}),
    (r'^by_status/(?P<status>[^\.^/]+)/$', 'moviering.moviering.views.by_status'),
    (r'^by_media/(?P<media_type>[^\.^/]+)/$', 'moviering.moviering.views.by_media'),
    (r'for_sale/$', 'moviering.moviering.views.for_sale'),
    (r'^by_dude/(?P<dude_key>[^\.^/]+)/$', 'moviering.moviering.views.by_dude'),
    (r'^by_group/(?P<group>[^\.^/]+)/$', 'moviering.moviering.views.by_group'),
    (r'^buy/(?P<movie_key>[^\.^/]+)/$', 'moviering.moviering.views.buy'),
    (r'^swap/(?P<movie_key>[^\.^/]+)/$', 'moviering.moviering.views.swap'),
    (r'^borrow/(?P<movie_key>[^\.^/]+)/$', 'moviering.moviering.views.borrow'),
    (r'^kudos/(?P<movie_key>[^\.^/]+)/$', 'moviering.moviering.views.kudos'),
    (r'^by_genre/(?P<genre>[^\.^/]+)/$', 'moviering.moviering.views.by_genre'),
    (r'users/$', 'moviering.moviering.views.list_users'),
    (r'^grant_access/(?P<dude_key>[^\.^/]+)/$', 'moviering.moviering.views.grant_access'),
    (r'^revoke_access/(?P<dude_key>[^\.^/]+)/$', 'moviering.moviering.views.revoke_access'),
    (r'^set_unavailable/(?P<movie_key>[^\.^/]+)/$', 'moviering.moviering.views.set_unavailable'),
    (r'wanted_movies/$', 'moviering.moviering.views.wanted_movies'),
    (r'most_kodus/$', 'moviering.moviering.views.most_kodus'),
    (r'blurays/$', 'moviering.moviering.views.blurays'),
    (r'dvds/$', 'moviering.moviering.views.dvds'),
    (r'by_rating/$', 'moviering.moviering.views.by_rating'),    
    (r'process_multiple/$', 'moviering.moviering.views.process_multiple'),
    (r'give_rating/(?P<movie_key>\w+)/(?P<rating>\w+)/$', 'moviering.moviering.views.give_rating'),
    (r'^delete_comment/(?P<comment_key>[^\.^/]+)/$', 'moviering.moviering.views.delete_comment'),

    (r'^borrow_to/$', 'moviering.moviering.views.borrow_to'),
    (r'^list_loans/$', 'moviering.moviering.views.list_loans'),
    (r'^reviews/$', 'moviering.moviering.views.reviews'),
    (r'^to_xml/$', 'moviering.moviering.views.to_xml'),
    #(r'test/$', 'moviering.moviering.views.test'),
)
